//
//  UIView+ZLCategory.h
//  ZLCategory
//
//  Created by zhaozl on 2022/4/30.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UIView (ZLCategory)

/// X坐标
@property (nonatomic, assign) CGFloat zl_x;

/// Y坐标
@property (nonatomic, assign) CGFloat zl_y;

/// 宽度
@property (nonatomic, assign) CGFloat zl_width;

/// 高度
@property (nonatomic, assign) CGFloat zl_height;

/// X (origin.x + width)
@property (nonatomic, assign) CGFloat zl_right;

/// Y(origin.y  + height)
@property (nonatomic, assign) CGFloat zl_bottom;

/// X中间坐标
@property (nonatomic, assign) CGFloat zl_centerX;

/// Y中间坐标
@property (nonatomic, assign) CGFloat zl_centerY;

/// 圆角
@property (nonatomic, assign) CGFloat zl_cornerRadius;

/// 边框宽度
@property (nonatomic, assign) CGFloat zl_borderWidth;

/// 边框颜色
@property (nonatomic, assign) UIColor *zl_borderColor;

/// 截图
- (UIImage *)zl_shootImage;

/// 获取当前view的控制器
- (UIViewController *)zl_getViewController;

/// 添加响应事件
/// @param target 目标对象
/// @param action 事件处理
- (void)zl_addTarget:(id)target action:(SEL)action;

/// 阴影
- (void)zl_defaultShadow;

#pragma mark - 手势

/// 添加点击手势
- (void)zl_addTap:(id)target sel:(SEL)sel;

/// 长安手势
- (void)zl_addLongTap:(id)target sel:(SEL)sel;

/// 拖动手势
- (void)zl_addPan:(id)target sel:(SEL)sel;

#pragma mark - layer

- (void)zl_cornersRadius:(CGFloat)radius corners:(UIRectCorner)corners;

/// 设置渐变色
- (void)zl_gradientsColors:(NSArray <UIColor *> *)colors;

@end

NS_ASSUME_NONNULL_END
